<?php
/**
 * 菜单头个人信息
 * @link https://ym2.cleverstone.top
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

use builder\helper\App;
use builder\helper\Url;
use common\models\SystemGroupService;

/* @var $this \yii\web\View */
$identity = Yii::$app->user->identity;
/* @var \common\models\Admin $identity */
$avatar = $identity && $identity->photo ? $identity->photo : '/media/image/avatar.jpg';
?>
    <li class="ym2-nav-header">
        <div class="ym2-brand px-2">
            <div class="ym2-brand-content anim-sort-in"><?= App::params('admin.brandName') ?></div>
        </div>
        <div class="ym2-personal px-3 py-4">
            <img class="inline-block anim-spin-infinite" src="<?= Url::to($avatar, '') ?>" alt>
            <div class="inline-block align-middle pl-2 clearfix">
                <p class="f13 p-content pb-2"><?= $identity->username ?></p>
                <p class="f12 p-content badge badge-primary font-weight-lighter float-right"><?= SystemGroupService::getNameById($identity->group) ?></p>
            </div>
        </div>
    </li>
